import {BasicColumn, FormSchema} from '@apps/antd-admin/src/components/Table';
import {RenderType} from '@pkg/setting';
import {render} from "@apps/antd-admin/src/hooks/render/renderUtils";
export const columns: BasicColumn[] = [
  {
    title: '业务员',
    dataIndex: 'appUserName',
    width: 150,
  },
  {
    title: '车辆型号',
    dataIndex: 'carModel',
    width: 150,
  },
  {
    title: '车型名称',
    dataIndex: 'modelName',
    width: 150,
    customRender: render.renderTip,
  },
  {
    title: '评估类型',
    dataIndex: 'evaluationType',
    width: 150,
    dictData: [
      {label: '车抵', value: 1},
      {label: '消费', value: 2},
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '首次上牌',
    dataIndex: 'firstLicensing',
    width: 150,
  },
  {
    title: '评估金额',
    dataIndex: 'evaluationAmount',
    width: 150,
  },
  {
    title: '上牌城市',
    dataIndex: 'cityName',
    width: 150,
  },
  {
    title: '行驶里程(万公里)',
    dataIndex: 'mileage',
    width: 150,
  },
  {
    title: '评估时间',
    dataIndex: 'createTime',
    width: 150,
  }
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'userName',
    label: '业务员姓名',
    component: 'Input',
    colProps: {span: 3},
  },
  {
    field: 'evaluationType',
    label: '评估类型',
    component: 'Select',
    colProps: { span: 3 },
    componentProps: {
      options: [
        { label: '车抵', value: 1 },
        { label: '消费', value: 2 }
      ],
    },
  }
];

export const formSchema: FormSchema[] = [
  {
    label: '车辆型号',
    field: 'carModel',
    component: 'Input',
    required: true,
  },
  {
    label: '首次上牌',
    field: 'firstLicensing',
    component: 'Input',
    required: true,
  },
  {
    label: '评估金额',
    field: 'evaluationAmount',
    component: 'Input',
    required: true,
  },
  {
    label: '车型名称',
    field: 'modelName',
    component: 'Input',
    required: true,
  },
  {
    label: '行驶里程(万公里)',
    field: 'mileage',
    component: 'InputNumber',
    required: true,
  }
];
